﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MiniFox.Components
{
    /// <summary>
    /// 
    /// </summary>
    [AttributeUsage(AttributeTargets.Class)]
    public sealed class AutoResolveAttribute : Attribute
    {
        string _name;
        bool _default;
        bool _replace;
        /// <summary>
        /// 
        /// </summary>
        public AutoResolveAttribute() : this(null, true, true)
        {
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        public AutoResolveAttribute(string name) : this(name, false)
        {
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <param name="replace"></param>
        public AutoResolveAttribute(string name, bool replace) : this(name, replace, false)
        {

        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <param name="defaultProvider"></param>
        /// <param name="replace"></param>
        public AutoResolveAttribute(string name, bool replace, bool defaultProvider)
        {
            _name = name;
            _default = defaultProvider;
            _replace = replace;
        }
        /// <summary>
        /// 
        /// </summary>
        public string ProviderName
        {
            get { return _name; }
        }
        /// <summary>
        /// 
        /// </summary>
        public bool DefaultProvider
        {
            get { return _default; }
        }
        /// <summary>
        /// 
        /// </summary>
        public bool Replace
        {
            get { return _replace; }
        }
    }
}
